<?php
FLEA::loadClass('FLEA_Db_TableDataGateway');

class	Model_Action	extends		FLEA_Db_TableDataGateway
{
	var		$tableName		=	'action';
	var		$primaryKey		=	'ActionID';

	var	$hasMany	=	array(
		array(
				'tableClass'	=>	'Model_Description',
				'foreignKey'	=>	'ActionID',
				'mappingName'	=>	'descriptions',
		)
	);
	/**
	 * get action informaton of the invention
	 *
	 * @param unknown_type $actionID
	 */
	function	findAction($actionID)
	{
		return $this->findByField('ActionID',$actionID);
	}

	function	findOfficeActions($inventionID)
	{
		return $this->findAll('Type=5 and InventionID='.$inventionID,"OfficeActionMailed desc");
	}
	
	function	findResponseActions($actionID)
	{
		return $this->findAll('ResponseActionID='.$actionID);
	}

	function	findActions($inventionID)
	{
		return $this->findAll('InventionID='.$inventionID);
	}
}
?>